<?php
/**
* 描述：模板预载类。
*/
abstract class Controller_Public_Preload extends Controller{
    const TEMPLATE_PRELOAD_MODE_COMMON='common';

    const TEMPLATE_PRELOAD_MODE_LEFT='left';

    const TEMPLATE_PRELOAD_MODE_ACCOUNT_COMMON='account_common';

    const TEMPLATE_PRELOAD_MODE_ACCOUNT_NOLEFT='account_noleft';

    /**
    * 描述：模板预捆绑模式标量。
    * @var     string
    * @access  protected
    */
    protected $TemplatePreLoadMode=self::TEMPLATE_PRELOAD_MODE_COMMON;

    public function __Construct($method){
        if(isset($this->TemplatePreLoadMode)){
            if($this->TemplatePreLoadMode===self::TEMPLATE_PRELOAD_MODE_COMMON){
                $this->Header();
                $this->Footer();
            }
            elseif($this->TemplatePreLoadMode===self::TEMPLATE_PRELOAD_MODE_LEFT){
                $this->Header();
                $this->Footer();
                $this->Left();
            }
            elseif($this->TemplatePreLoadMode===self::TEMPLATE_PRELOAD_MODE_ACCOUNT_COMMON){
                $this->AccountHeader();
                $this->AccountFooter();
                $this->AccountLeft();
            }
            elseif($this->TemplatePreLoadMode===self::TEMPLATE_PRELOAD_MODE_ACCOUNT_NOLEFT){
                $this->AccountHeader();
                $this->AccountFooter();
            }
        }
        //~
        parent::__Construct($method);
    }

    private function Header(){
        echo 'rendering template header','<br/>';
    }

    private function Footer(){
        echo 'rendering template footer','<br/>';
    }

    private function Right(){
        echo 'rendering template right','<br/>';
    }

    private function Left(){
        echo 'rendering template left','<br/>';
    }

    private function AccountHeader(){
        echo 'rendering template account header','<br/>';
    }

    private function AccountFooter(){
        echo 'rendering template account footer','<br/>';
    }

    private function AccountLeft(){
        echo 'rendering template account leftmenu','<br/>';
    }
}
